<include file="Public:header" />
<include file="Public:leftside" />
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i> <a href="/">首页</a></li>
			<li class="active">商品分类管理</li>
		</ul>
	</div>
	<div class="page-content">
	<div class="row panel-body" style="width: 100%;margin: 5px auto;padding: 15px 0;">
		<a href="{:U('Shop/index')}" class="btn btn-sm btn-default">商品管理</a>
		<a href="{:U('Shop/ticketTypeList')}" class="btn btn-sm btn-primary">商品分类</a>
		<a href="{:U('Shop/brandList')}" class="btn btn-sm btn-default">商品品牌</a>
		<a href="{:U('Shop/attributelist')}" class="btn btn-sm btn-default">商品类型</a>

	</div>
    	<form action="/shop/<?=ACTION_NAME?>/" method="get">
	       <section class="panel-default m-b-sm">
				<div class="alert alert-info">
					<p>
	                  <i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
	                </p>
                    <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>该页面展示了商城所有的分类信息，可对商品分类进行编辑修改操作。</p>
                    <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>可输入分类名称关键字进行搜索。</p>
            	</div>
			</section>
	        <div class="search_box_con" style="float: left;width: 100%;padding: 5px 0;">
	        <div class="col-sm-9" style="padding: 0">
				<a href="__CONTROLLER__/ticketTypeAdd/" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加分类 </a> 
				
			</div>
			<div class="col-sm-2" style="padding: 0">
				<input type="text" name="name" value="{$_GET['name']}" class="form-control input-sm" placeholder="请输入分类名称"/>
			
			</div>
			<div class="col-sm-1" style="padding: 0">
		
			<input type="submit" class="btn btn-primary btn-sm" value="搜索"> 
			</div>
	         	
	        </div>
        </form>
    
			<table id="sample-table-1" class="table table-striped table-bordered table-hover">
			<thead>
        	  <tr class="f_black bg_gray">
                <th>类型id</th>
                <th>类型名称</th>
                <th>类型目录树</th>
              
                <th>添加时间</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
            <volist name="array" id="row">
        	<?PHP
        		
            	$numFlag	=	count( explode(',',$row['bids']) )-2;
				$flag	=	'';
				for( $i = 0; $i < $numFlag; $i++ ){
					$flag	.=	'├─';
				}
	        ?>
     		<tr class="list" id="list<?=$row['id']?>">
                <td style="width: 50px;">{$row['id']}</td>
                <td style="width: 200px; font-weight:bold; text-align:left; padding-left:20px;"><a href="/Mall/index/type_id/{$row.id}">{$flag}{$row['name']}</a></td>
                <td>{$row.bids|getBtypeId=###}</td>
        
                <td>{$row['addtime']|date="Y-m-d H:i:s",###}</td>
                <td>
                     <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                     			<button onclick="location.href='__CONTROLLER__/ticketTypeAdd/tid/<?=$row['id']?>'" class="btn btn-xs btn-success">
								 	添加子栏目
								 </button>
								
								 <button onclick="location.href='__CONTROLLER__/ticketTypeAdd/id/<?=$row['id']?>'" class="btn btn-xs btn-info">
								 	编辑
								 </button>
								<button url="__CONTROLLER__/ticketTypeDelete/id/<?=$row['id']?>/ishidden/1" ajax="1" class="btn btn-xs btn-danger aclick"> 
									删除
								</button>
					  </div>
						
                </td>
            </tr>
            </volist>
           </tbody>
        </table>
        <div class="page">{$page}</div>
    </div>
</div>
<script type="text/javascript">
$(function(){
	$('body').delegate('#copyConfig','click',function(){
		$.get('/Area/copyConfigHtml',{type_id:$(this).attr('data')},function(data){
			$.layer({
				type:1,
				title:false,
				area:['80%','auto'],
				page:{
					html:data
				}
			});
		});
	});
	
	$('body').delegate('#getType','click',function(){
		$.get('/Area/copyConfigHtml',{keywords:$('#keywords').val(),type_id:$('#type_id').val()},function(data){
			layer.closeAll();
			$.layer({
				type:1,
				title:false,
				area:['80%','auto'],
				page:{
					html:data
				}
			});
		});
	});
	
	$('body').delegate('.ajaxListTicketType span','click',function(){
		$.get('/Area/copyConfig',{type_id:$('#type_id').val(),id:$(this).attr('data')},function(data){
			layer.closeAll();
			var dataArray	=	data.split('|||');
			layermsglink(dataArray[1],dataArray[2]);
		});
	});
});
</script>
<include file="Public:footer" />